package com.cloud.code.真题;

import java.util.*;

public class Demo19 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNext()) {
            String line = scanner.nextLine();
            String[] s = line.split(" ");
            int sum = 0;
            Map<Integer, Integer> map = new HashMap<>();
            for (int i = 0; i < s.length; i++) {
                sum = sum + Integer.parseInt(s[i]);
                map.put(i + 1, 0);
            }

            int start = 1;

            int cur = 1;
            int all = 0;
            while (true) {

                if (all == sum) {
                    break;
                }

                if (start % 7 == 0 || String.valueOf(start).contains("7")) {
                    map.put(cur, map.getOrDefault(cur, 0) + 1);
                    all++;
                }

                start++;
                cur++;
                if (cur > s.length) {
                    cur = 1;
                }
            }

            map.entrySet().stream().forEach(integerIntegerEntry -> {
                System.out.print(integerIntegerEntry.getValue() + " ");
            });

        }
    }
}
